CODE_PATH=/Users/mac/gitee/eureka-server
LOG_PATH=/Users/mac/gitee/log

cd $CODE_PATH

sudo kill -9 `ps -ef | grep eureka-server-0.0.1-SNAPSHOT.jar  | tr -s ' ' | awk -F' ' '{print $2}'`

mvn clean package -Dmaven.test.skip=true

cd $CODE_PATH/target


nohup java -jar eureka-server-0.0.1-SNAPSHOT.jar --spring.profiles.active=peer1 > $LOG_PATH/eurekapeer1.log &

echo "start peer1 success"

nohup java -jar eureka-server-0.0.1-SNAPSHOT.jar --spring.profiles.active=peer2 > $LOG_PATH/eurekapeer2.log &

echo "start peer2 success"